<?php
declare (strict_types = 1);

namespace app\api\model;

use think\Model;

/**
 * 资金充值提现记录
 * @mixin \think\Model
 */
class UserCashRar extends Model
{

    protected $json = ['notify'];
    protected $jsonAssoc = true;


    public function userInfo()
    {
        return $this->hasone("user", 'u_id', "u_id");
    }

  
    

    /**
     * 支付状态
     * @param  integer $int [键值]
     * @return [type]       [状态文字]
     */
    public static function getPayFlag($int = 0)
    {
        $res = [
            0  => __('unpaid'),
            1  => __('paid'),           
        ];

        return $int > 0 ? $res[$int] : $res;
    }

    public static function getCheckFlag($int = 0)
    {
        $res = [
            0 => __('to be approved'),
            1 => __('approved'),
        ];

        return $int > 0 ? $res[$int] : $res;
    }

    public static function getType($int = 0)
    {
        $res = [
            1 => __('recharge'),
            2 => __('withdrawal'),
        ];

        return $int > 0 ? $res[$int] : $res;
    }
}
